fix: panic on launch from tokio::spawn in window close handler#214
fix: panic on launch from tokio::spawn in window close handler#214MeckMan2025 wants to merge 2 commits intojamiepine:mainfrom
Conversation
The window close handler in on_window_event used tokio::spawn directly, which panics because there is no Tokio reactor running in that context. Replaced with tauri::async_runtime::spawn which correctly routes through Tauri's managed async runtime. Fixes: "there is no reactor running, must be called from the context of a Tokio 1.x runtime" panic on app launch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughRemoved a comment in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Cherry-picked and adapted from PR #89 and #214: - Linux audio capture via PulseAudio/PipeWire monitor sources (cpal) - AMD ROCm GPU support: HSA_OVERRIDE_GFX_VERSION env var, ROCm detection - Whisper Turbo model (openai/whisper-large-v3-turbo) in all endpoints - Cleaner Whisper language handling via generate_kwargs - tauri::async_runtime::spawn fix to prevent panic on app shutdown - Enable Linux (ubuntu-22.04) in release CI matrix
Summary
on_window_eventclose handler usedtokio::spawndirectly, which panics with "there is no reactor running, must be called from the context of a Tokio 1.x runtime" because the handler runs outside the Tokio runtime context.tauri::async_runtime::spawnwhich correctly routes through Tauri's managed async runtime.Details
One-line change in
tauri/src-tauri/src/main.rsline 678:This crash occurs on every launch — the app compiles and starts, then immediately panics before the window renders.
Test plan
window-close-requestedevent, responds, and window closes)🤖 Generated with Claude Code
Summary by CodeRabbit